Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 21, 2025

Summary

Disable the "Remove project" button when workspaces exist, matching backend constraints. The button becomes enabled only when all workspaces (active and archived) are deleted.

Changes

  • ProjectSidebar: Remove button is now disabled when project has any workspaces
    • Uses aria-disabled attribute for accessibility
    • Cursor changes to not-allowed when disabled
    • Tooltip explains what needs to be deleted (active, archived, or both)
  • WorkspaceContext: Added archivedCountByProject map to efficiently track archived workspace counts
    • Fetches active and archived workspaces in parallel on load
  • Storybook: Updated test story to verify disabled state instead of error popover

Tooltip Examples

  • 1 active: "Delete workspace first"
  • 2+ active: "Delete all N workspaces first"
  • N archived: "Delete N archived workspaces first"
  • Both: "Delete N active + M archived workspaces first"

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

@ammar-agent ammar-agent force-pushed the disable-project-delete-with-workspaces branch from 52a831b to 92ca0d1 Compare December 21, 2025 18:37
@ammar-agent ammar-agent changed the base branch from main to workspace-archiving December 21, 2025 18:38
Base automatically changed from workspace-archiving to main December 21, 2025 20:17
- Remove project button is disabled when project has any workspaces (active or archived)
- Shows explanatory tooltip based on workspace type:
  - 'Delete workspace first' (1 active workspace)
  - 'Delete all N workspaces first' (multiple active)
  - 'Delete N archived workspaces first' (archived only)
  - 'Delete N active + M archived workspaces first' (both)
- Added archivedCountByProject to WorkspaceContext for efficient archived count tracking
- Button uses aria-disabled and cursor-not-allowed styling when disabled

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
@ammar-agent ammar-agent force-pushed the disable-project-delete-with-workspaces branch from 92ca0d1 to b08a70e Compare December 21, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant